/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.moshi.test.learn.observers.consume.subject;
//===========ConcreteObserver.java===============
//具体的某个观察者
public class ConcreteObserver extends Observer {
    private String name;
    private String observerState;
    private ConcreteSubject subject;
    public ConcreteObserver(ConcreteSubject subject,String name){
        this.subject=subject;
        this.name=name;
    }
    @Override
    public void update() {
        observerState=subject.getSubjectState();
        System.out.println(String.format("%s的收到消息，内容是:%s", name,observerState));
    }
}